﻿using System.Collections.Generic;
using BoldBrick.SharePoint.CommonControls.DataObjects.Base;
using Microsoft.SharePoint;

namespace BoldBrick.OneIntranet.HR.DataObjects.Lists.TasksListData
{
	/// <summary>
	/// Metadata class of "Tasks" list
	/// </summary>
	public class TasksList : BaseList
	{
		public ListColumn PredecessorsColumn { get; private set; }
		public ListColumn StatusColumn { get; private set; }
		public ListColumn ContentTypeColumn { get; private set; }
		public ListColumn PriorityColumn { get; private set; }
		public ListColumn WorkflowNameColumn { get; private set; }
		public ListColumn PercentCompleteColumn { get; private set; }

		public TasksList()
		{
			this.EnableFolderCreation = false;
			this.EnableAttachments = false;

			this.PredecessorsColumn = SharePoint.CommonControls.DataObjects.SiteColumns.PredecessorsColumn;
			this.PredecessorsColumn.Hidden = true;

			this.StatusColumn = SharePoint.CommonControls.DataObjects.SiteColumns.StatusColumn;
			this.StatusColumn.ShowInEditForm = false;

			this.ContentTypeColumn = SharePoint.CommonControls.DataObjects.SiteColumns.ContentTypeColumn;
			this.ContentTypeColumn.ShowInEditForm = false;

			this.PriorityColumn = SharePoint.CommonControls.DataObjects.SiteColumns.PriorityColumn;
			this.PriorityColumn.ShowInEditForm = false;

			this.WorkflowNameColumn = SharePoint.CommonControls.DataObjects.SiteColumns.WorkflowNameColumn;
			this.WorkflowNameColumn.ShowInEditForm = false;

			this.PercentCompleteColumn = SharePoint.CommonControls.DataObjects.SiteColumns.PercentCompleteColumn;
			this.PercentCompleteColumn.Hidden = true;
		}

		protected override string GetListTitleResourceKey()
		{
			return "List_Tasks_Title";
		}

		protected override string GetListNameResourceKey()
		{
			return "List_Tasks_Name";
		}

		protected override SPListTemplateType? GetListTemplateType()
		{
			return SPListTemplateType.Tasks;
		}

		public override List<BaseContentType> GetContentTypes()
		{
			List<BaseContentType> contentTypes = new List<BaseContentType>
			                                     	{
			                                     		ContentTypes.ContentTypes.InterviewTaskContentType,
														ContentTypes.ContentTypes.TestTaskContentType,
			                                     		ContentTypes.ContentTypes.ReferenceCallTaskContentType,
														ContentTypes.ContentTypes.FinalDecisionTaskContentType,
														ContentTypes.ContentTypes.ReviewTaskContentType,
														ContentTypes.ContentTypes.ScheduleInterviewTaskContentType
			                                     	};
			return contentTypes;
		}

		
	}
}
